#ifndef QIMAGEUPDATETHREAD_H
#define QIMAGEUPDATETHREAD_H
#include <QVector>
#include <QThread>
#include <QImage>
#include <QMutex>
#include <QWaitCondition>

#include "lockimage.h"

class QImageUpdateThread : public QThread
{
    Q_OBJECT
public:
    explicit QImageUpdateThread(int startId, int endId, QVector<LockImage *> *lockImages, QObject *parent = Q_NULLPTR);
    ~QImageUpdateThread();

    int startUpdateImage();

    bool isQuit();

protected:
    void run() Q_DECL_OVERRIDE;

signals:
    void signalNewImage(int id, QImage *image);

private:

    volatile bool mQuit;
    int mStartId;
    int mEndId;

    QVector<QString> mImagePathVector;
    QVector<LockImage *> *mLockImageVector;

    QMutex mutex;
};

#endif // QIMAGEUPDATETHREAD_H
